package com.ydzh.kfqgwvisitor.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 接口请求日志
 * </p>
 *
 * @author zcj
 * @since 2021-12-13
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "RequestLog对象", description = "接口请求日志")
public class RequestLog implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "ID")
    @TableId(value = "ID", type = IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty(value = "访问者的userAgent")
    @TableField("USER_AGENT")
    private String userAgent;

    @ApiModelProperty(value = "访问的url")
    @TableField("URL")
    private String url;

    @ApiModelProperty(value = "请求的方式")
    @TableField("METHOD")
    private String method;

    @ApiModelProperty(value = "请求的IP")
    @TableField("IP")
    private String ip;

    @ApiModelProperty(value = "接口描述")
    @TableField("DESCRIPTION")
    private String description;

    @ApiModelProperty(value = "访问时间")
    @TableField("CREATE_TIME")
    private LocalDateTime createTime;

    public RequestLog() {
    }

    public RequestLog(String userAgent, String url, String method, String ip, LocalDateTime createTime) {
        this.userAgent = userAgent;
        this.url = url;
        this.method = method;
        this.ip = ip;
        this.createTime = createTime;
    }

}
